package com.myapp.imp.war.msg;

import java.io.IOException;

import com.myapp.imp.war.logical.CGInsertTowerLogical;
import com.myapp.msg.ann.MsgDefine;
import com.myapp.msg.base.BaseMsg;
import com.myapp.msg.type.MsgPermission;


/**
 * 文件名：CGInsertTowerMsg.java
 * <p>
 * 功能：在指定地方放置一个塔
 * <p>
 * 版本：1.0.0
 * <p>
 * 作者：Builderd by AppTools
 * <p>
 */
@MsgDefine(id = 10303, name = "CGInsertTower", permission = MsgPermission.AUTHORIZE, logicalClass = CGInsertTowerLogical.class)
public class CGInsertTowerMsg extends BaseMsg {

	public CGInsertTowerMsg(){
	}

	//塔id
	private int towerId = 0;
			
	//放置塔的x位置
	private int x = 0;
			
	//放置塔的y位置
	private int y = 0;
			
	//塔id的get方法
	public int getTowerId() {
		return towerId;
	}

	//塔id的set方法
	public void setTowerId(int towerId) {
		this.towerId = towerId;
	}
	
	//放置塔的x位置的get方法
	public int getX() {
		return x;
	}

	//放置塔的x位置的set方法
	public void setX(int x) {
		this.x = x;
	}
	
	//放置塔的y位置的get方法
	public int getY() {
		return y;
	}

	//放置塔的y位置的set方法
	public void setY(int y) {
		this.y = y;
	}
	
	@Override
	public void read() throws IOException {
		//读取Field
		//读取塔id
		this.setTowerId(this.readInt());
		
		//读取放置塔的x位置
		this.setX(this.readInt());
		
		//读取放置塔的y位置
		this.setY(this.readInt());
		
		//读取Bean
	}
	
	@Override
	public void write() throws IOException {
		//写入塔id
		this.writeInt(this.getTowerId());
		
		//写入放置塔的x位置
		this.writeInt(this.getX());
		
		//写入放置塔的y位置
		this.writeInt(this.getY());
		
	}
}
